//
//  YD_sendGift_ColCell.m
//  SpeedDating
//
//  Created by isu on 17/1/16.
//  Copyright © 2017年 isu. All rights reserved.
//

#import "GiftgivingCell.h"

@interface GiftgivingCell()
/** baseImageV*/
@property (nonatomic, strong)UIImageView *baseImageV;
/** giftImageV*/
@property (nonatomic, strong)UIImageView *giftImageV;
/** titleLab*/
@property (nonatomic, strong)UILabel *titleLab;
@end

@implementation GiftgivingCell
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.baseImageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"giftBackG"]];
        self.baseImageV.frame = self.contentView.bounds;
        [self.contentView addSubview:self.baseImageV];
        
        self.giftImageV = [UIImageView new];
        [self.baseImageV addSubview:self.giftImageV];
        [self.giftImageV  mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(10);
            make.right.mas_equalTo(-10);
            make.top.mas_equalTo(10);
           // make.left.right.top.mas_equalTo(self.contentView);
            make.height.mas_equalTo(self.giftImageV.mas_width).multipliedBy(4/3.3);
        }];
        
        self.titleLab = [UILabel new];
        [self.giftImageV addSubview:self.titleLab];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.right.left.mas_equalTo(self.contentView);
            make.top.mas_equalTo(self.giftImageV.mas_bottom);
        }];
        self.titleLab.textAlignment = NSTextAlignmentCenter;
        self.titleLab.textColor = [UIColor colorWithRed:244/255.0 green:48/255.0 blue:83/255.0 alpha:1.0f];
        self.titleLab.text = @"0钻石";
        self.titleLab.font = [UIFont systemFontOfSize:13.0f];
    }
    return self;
}

-(void)setGift_sendModel:(GiftgivingModel *)Gift_sendModel{
    _gift_sendModel = Gift_sendModel;
    [self.giftImageV sd_setImageWithURL:[NSURL URLWithString:HttpImgUrl(Gift_sendModel.img)] placeholderImage:[UIImage imageNamed:@"llustration"]];
    self.titleLab.text = [NSString stringWithFormat:@"%ld钻石",(long)Gift_sendModel.charm];
    
}
@end
